package com.bootdo.system.domain;

import com.bootdo.app.enums.GroupBuyingStatusEnum;
import java.time.LocalDateTime;
import java.util.Calendar;
import java.util.Date;

public class TbGroupBuying {
    private Integer id;

    private Integer createUserId;

    private String sid;

    private String goodsId;

    private Integer status;

    private Date createDateTime;

    private Date endDateTime;

    private Date updateDateTime;
    
    private String wxInfo;
    
    private String goodsInfo;
    
    private int yqrNum;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(Integer createUserId) {
        this.createUserId = createUserId;
    }

    public String getSid() {
        return sid;
    }

    public void setSid(String sid) {
        this.sid = sid == null ? null : sid.trim();
    }

    public String getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(String goodsId) {
        this.goodsId = goodsId == null ? null : goodsId.trim();
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getCreateDateTime() {
        return createDateTime;
    }

    public void setCreateDateTime(Date createDateTime) {
        this.createDateTime = createDateTime;
    }

    public Date getEndDateTime() {
        return endDateTime;
    }

    public void setEndDateTime(Date endDateTime) {
        this.endDateTime = endDateTime;
    }

    public Date getUpdateDateTime() {
        return updateDateTime;
    }

    public void setUpdateDateTime(Date updateDateTime) {
        this.updateDateTime = updateDateTime;
    }

    public static TbGroupBuying makeGroupBuy(Integer createUserId,String sid,String goodsId){
        Calendar calendar = Calendar.getInstance();
        TbGroupBuying groupBuying = new TbGroupBuying();
        groupBuying.setCreateUserId(createUserId);
        groupBuying.setCreateDateTime(calendar.getTime());
        groupBuying.setSid(sid);
        groupBuying.setGoodsId(goodsId);
        calendar.add(Calendar.DATE,1);
        groupBuying.setEndDateTime(calendar.getTime());
        groupBuying.setStatus(GroupBuyingStatusEnum.MAKE.getStatus());
        return groupBuying;
    }

    public static TbGroupBuying updateStatus(Integer id,Integer status){
        TbGroupBuying groupBuying = new TbGroupBuying();
        groupBuying.setId(id);
        groupBuying.setStatus(status);
        groupBuying.setUpdateDateTime(Calendar.getInstance().getTime());
        return groupBuying;
    }

	public String getGoodsInfo() {
		return goodsInfo;
	}

	public void setGoodsInfo(String goodsInfo) {
		this.goodsInfo = goodsInfo;
	}

	public String getWxInfo() {
		return wxInfo;
	}

	public void setWxInfo(String wxInfo) {
		this.wxInfo = wxInfo;
	}

	public int getYqrNum() {
		return yqrNum;
	}

	public void setYqrNum(int yqrNum) {
		this.yqrNum = yqrNum;
	}
    
    

}